package hr.fer.zemris.gep;

import java.util.Random;
import hr.fer.zemris.math.ConstTerminal;

public class IntegerTerminalFactory implements INodeFactory {
	private int min;
	private int max;
	
	public IntegerTerminalFactory(int min, int max) {
		this.min = min;
		this.max = max;
	}
	
	@Override
	public INode create(Random rng) {
		int rand = rng.nextInt(max - min + 1);
		return new ConstTerminal(min + rand);
	}

	@Override
	public int getAirity() {
		return 0;
	}

}
